import Taro, { Component, Config } from '@tarojs/taro'
import { View, Icon } from '@tarojs/components'
import './index.less'

export default class Topbar extends Component{

    componentWillMount () { }

    componentDidMount () { }
  
    componentWillUnmount () { }
  
    componentDidShow () { }
  
    componentDidHide () { }
    
    constructor(props){
        super(props);
    }
    
    config: Config = {

    }

    back(){
        Taro.navigateBack()
    }
    
    render(){

        return (

            <View className="topbar">
                <View onClick={this.back} className="icon back iconfont icon-left"></View>
                <View className="slot">
                    {this.props.children}
                </View>
            </View>
            
        )
        
    }
    
    
}